package com.yld.scott.ch13;

public class DogTest {
	
	
	public static void main(String[] args) throws Exception {
		
		
		String dogStr="com.yld.scott.ch13.Dog";
		
		//月饼  月饼模型Class  你要造1个月饼  用月饼模型clazz  字节码文件 只有1份
		Class<Dog>  clazz = (Class<Dog>) Class.forName(dogStr);
		
		Dog dog = clazz.getConstructor(int.class,String.class).newInstance(2,"哈士奇");
		
		System.out.println(dog);
		
		ScottController controller = clazz.getAnnotation(ScottController.class);
		
		System.out.println("age="+controller.age());
		System.out.println("name="+controller.name());
		System.out.println("value="+controller.value());
		
		
	}

}
